const {
  request
} = require('../http/request.js')

module.exports = {
  /**
   * 提交认证信息
   */
  sumitAttestation: (url, method, params) => {
    return request(url, method, params);
  },
  /**
   * 发起直播
   * @param {*} url 
   * @param {*} method 
   * @param { } params 
   * 
   */
  startLiveApi: (params) => {
    return request('api/launch-live','POST', params);
  },

  /**
   * 获取直播流
   */
  getLiveStream: (params) => {
    return request('api/live-info','GET',params)
  },
 /**
  * 发起连麦申请
  * @param {live_id} params 
  */
  joinLiveCall: (params) => {
    return request('api/join-live-call', 'POST', params)
  },
  /**
   * 主播确认连麦开始
   * @param {live_id ,userid} params 
   */
  liveCallStart: (params) => {
    return request('api/live-call-start', 'POST', params)
  },
  /**
   * 结束连麦
   * @param {live_id} params 
   */
  liveCallEnd :(params) => {
    return request('api/live-call-end', 'POST', params)
  },
  /**
   * 检测用户余额
   */
  liveCallCheck: (params) => {
    return request('api/live-call-check', 'get', params,false,false)
  },
  /**
   * 主播下播
   */
  liveClose: (params) => {
    return request('api/stop-live', 'POST', params)
  },
  /**
   * 观众离开直播间
   */
  audienceLeaveLive(params){
    return request('api/quit-liveroom', 'POST', params)
  },
  /**
   * 拒绝连麦
   */
  liveRejectCall(params){
    return request('api/live-call-cancel', 'POST', params)
  },
  /**
   * 获取麦序列表
   */
  getMicCallList(params){
    return request('api/live-call-queue', 'GET', params)
  },

  /**
   * 获取直播间信息
   */
  getLiveRoomInfo(params){
    return request('api/live-info', 'GET', params,false,false)
  }
  

  
}

